/* components */
import TaskPoolListComponents from '@src/modules/task/taskTypes/taskPool/TaskPoolListComponents'
import PlanTimeDialog from '@src/modules/task/view/components/PlanTimeDialog.vue';
import CalendarPlanTimeDialog from '@src/modules/task/view/components/CalendarPlanTimeDialog.vue';
import TaskTransfer from '@src/modules/task/taskTypes/taskPool/componets/TaskTransfer.vue'
import TaskMap from '@src/modules/task/taskTypes/taskPool/componets/TaskMap.vue'
import AllotMapDialog from '@src/modules/task/taskTypes/allot/components/AllotMapDialog/AllotMapDialog.tsx'
/* enum */
import StorageKeyEnum from '@model/enum/StorageKeyEnum'
/* entity */
import Field from '@model/entity/Field'
import EsTask from '@model/entity/EsTask'
/* model */
import { getTaskPoolInfoResult, getTaskPoolInitDataResult } from '@model/param/out/Task'
import Column from '@model/types/Column'
/* vue */
import { Ref } from 'vue-property-decorator'

class TaskPoolListData extends TaskPoolListComponents {
  // 地图派单弹窗
  @Ref() AllotMapDialogComponent!: AllotMapDialog
  // 工单计划时间弹窗
  @Ref() readonly PlanTimeDialogComponent!: PlanTimeDialog
  // 工单计划时间弹窗
  @Ref() readonly CalendarPlanTimeDialogComponent!: CalendarPlanTimeDialog
  // 工单批量转派弹窗
  @Ref() readonly TaskTransferComponent!: TaskTransfer
  
  /* 高级搜索字段缓存数据 */
  public advancedSearchFieldStorageKey: StorageKeyEnum = StorageKeyEnum.TaskPoolListSearchFields
  /* 列数据 */
  public columns: Column[] = this.getColumnFields(this) as Column[]
  /* 当前接单的工单数据 */
  public currentAcceptTask: EsTask | null = null
  /* 当前接单的工单计划时间 */
  public currentAcceptTaskPlanTimeField: Field | undefined = undefined
  /* 当前接单的工单计划开始时间 */
  public currentAcceptTaskPlanStartTimeField: Field | undefined = undefined
  /* 当前接单的工单计划完成时间 */
  public currentAcceptTaskPlanEndTimeField: Field | undefined = undefined
  /* 初始数据 */
  public initData: getTaskPoolInitDataResult = {
    taskTypeList: [],
    taskConfig: undefined,
    hasSub: false,
    restructAllot: false
  }
  /* 选择列 缓存键名 */
  public selectColumnStorageKey: StorageKeyEnum = StorageKeyEnum.TaskPoolTableColumns
  /* pageSize 缓存键名 */
  public pageSizeStorageKey: StorageKeyEnum = StorageKeyEnum.TaskPoolPageSize
  /* 地图是否显示 */
  public mapShow: boolean = false
  /* 工单池头部数据信息 */
  public taskPoolCountInfo: getTaskPoolInfoResult = {
    overTimeCount: '--',
    taskPoolTotal: '--'
  }
  public preViews: Array<any> = []
  public viewportSearchModel: Array<any> = []
  public currentView: any = null

  // 快捷筛选条件 提供给视图使用
  public shortcutConditions: any = {
    // tasksState: '',
    taskType: '',
    // visualAngle: '',
    // exceptionNodes: '',
  }
  public quickConditionTaskTypeName = ''
}

export default TaskPoolListData
